﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web.Mvc;

using Mvc.XForms.Controls.Settings;

namespace Mvc.XForms.Controls {
	public static class XFormExtensions {
		public static XFormSettings<TContext> XForm<TContext>(this HtmlHelper html, TContext context) {
			var xform = new XForm<TContext>(html.ViewContext.HttpContext, html.ViewContext.ViewData.ModelState, context, html);
			return xform.Settings;
		}
	}
}